﻿@model List<DLULearningNetworkModel.Friend>
@{
    
    Guid curUser = DLULearningNetwork.ActionFilterAttributes.RequireUserLogin.LoginUser.AccountID_u;
    DLULearningNetworkModel.Account accountOfFriend = null;
}
@using DLULearningNetwork.Libs
@if (Model != null && Model.Count > 0)
{
    <table class="tbl1" cellspacing="0" style="margin-top: 10px;">
        <tr>
            <th>
                Avatar
            </th>
            <th>
                Họ
            </th>
            <th>
                Tên
            </th>
            <th>
                Nickname
            </th>
            <th>
                Chấp nhận
            </th>
            <th>
                Xóa
            </th>
        </tr>
        @for (int i = 0; i < Model.Count; i++)
        {
            //Undone : sap xep ban theo ten, theo ngay trong model??
            accountOfFriend = Model[i].AccountReference.Value;
            <tr @if (i % 2 != 0)
                {
                    string str = "class=odd"; @str;
                } style="line-height:50px" friendID="@Model[i].FriendID_u">
                <td>
                    <a href = "/UserPage/UserHome/@accountOfFriend.Nickname_s">
                        @if (!string.IsNullOrEmpty(accountOfFriend.Avatar_s))
                        {
                            <img src="@Url.Content(accountOfFriend.Avatar_s.Replace("Original", "Small"))" alt="avatar" style="border:0;width:40px;height:40px;padding-top:5px;"/>
                        }
                        else
                        { 
                            <img src="@Url.Content("~/Content/Images/avatar.gif")" alt="avatar" style="border:0;width:40px;height:40px;padding-top:5px;"/>
                        }
                    </a>
                </td>
                <td>
                    <span style="display: block;">@accountOfFriend.LastName_s</span>
                </td>
                <td>
                    <span style="display: block;">@accountOfFriend.FirstName_s</span>
                </td>
                <td>
                    <span style="display: block;">@accountOfFriend.Nickname_s</span>
                </td>
                <td>
                    <a href="#" name="Accept">Chấp nhận</a>
                </td>
                <td>
                    <a href="#" name="Delete">Xóa</a>
                </td>
            </tr>
        }
    </table>
    <div class="pagination pagination-left" style="margin-left: 3px;">
        <ul class="pager">
            @Html.Partial("UCPager2", new DLULearningNetwork.ViewModels.PagerViewModel2(ViewBag.TotalItems, Constants.DEFAULT_PAGESIZE, Constants.DEFAULT_NUMBER_OF_ITEMS_PERPAGE,
                 ViewBag.CurrentPage))
        </ul>
    </div>
}
else
{
    <span>Không có yêu cầu kết bạn nào</span>
}
